package com.qrpay.model.enums;

/**
 * 用户邀请的层级(目前设定只有三级)
 */
public enum ExtendLevel {
    First("First", "一级"),
    Second("Second", "二级"),
    Third("Third", "三级"),
    ;

    private final String code;
    private final String desc;

    ExtendLevel(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public boolean equals(String code) {
        return this.code.equals(code);
    }

    public static ExtendLevel byCode(String code) {
        for (ExtendLevel t : values()) {
            if (t.equals(code)) return t;
        }
        return null;
    }

}
